<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
                'id' => 'category-form',
                'enableAjaxValidation' => false,
            ));
    ?>

    <p class="note"><span class="required">*</span> là bắt buộc.</p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 64)); ?>
        <?php echo $form->error($model, 'name'); ?>
    </div> 

    <div class="row">
        <?php echo $form->labelEx($model, 'parent_id'); ?>
        <?php
        $this->widget('application.components.Relation',
                array(
                    'model' => 'Category',
                    'relation' => 'parent',
                    'fields' => 'name',                    
                    'allowEmpty' => true,
                    'style' => 'listbox')
        ); ?>
        <?php echo $form->error($model, 'parent_id'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Tạo' : 'Lưu'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->